//
//  NavgationVC.swift
//  SplashMask
//
//  Created by tianqi on 2017/11/8.
//  Copyright © 2017年 david.com. All rights reserved.
//

import UIKit

class NavgationVC: UINavigationController {
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
//        let bgView = UIView(frame: view.bounds)
//        bgView.backgroundColor = UIColor.white
//        view.addSubview(bgView)
//        view.bringSubview(toFront: bgView)
//
//
//        let mask = CALayer()
//        mask.bounds = CGRect(x: 0, y: 0, width: 100, height: 100)
//        mask.position = view.center
//        mask.contents = #imageLiteral(resourceName: "logo").cgImage
//        view.layer.mask = mask
//
//
//        let logoAnimation = CAKeyframeAnimation(keyPath: "bounds")
//        logoAnimation.duration = 1.0
//        logoAnimation.beginTime = CACurrentMediaTime() + 1.0
//        logoAnimation.isRemovedOnCompletion = false
//        logoAnimation.fillMode = kCAFillModeForwards
//        let times = [NSNumber(value: 0),NSNumber(value: 0.5),NSNumber(value: 1)]
//        logoAnimation.keyTimes = times
//        let bounds1 = CGRect(x: 0, y: 0, width: 100, height: 100)
//        let bounds2 = CGRect(x: 0, y: 0, width: 80, height: 80)
//        let bounds3 = CGRect(x: 0, y: 0, width: 2000, height: 2000)
//        logoAnimation.values = [bounds1,bounds2,bounds3]
//        logoAnimation.timingFunctions = [CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut),
//        CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut),
//        CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)]
//        view.layer.mask?.add(logoAnimation, forKey: "logoAnimation")
//
//        UIView.animate(withDuration: 0.2, delay: 1.3, animations: {
//            bgView.alpha = 0
//        }) { (_) in
//            bgView.removeFromSuperview()
//        }
//
//        UIView.animate(withDuration: 0.25, delay: 1.3, animations: {
//            self.view.transform = self.view.transform.scaledBy(x: 1.45, y: 1.45)
//            //CGAffineTransform.init(scaleX: 1.5, y: 1.5)
//
//        }) { (_) in
//            UIView.animate(withDuration: 0.3, delay: 0, options: UIViewAnimationOptions.curveEaseOut, animations: {
//                self.view.transform = CGAffineTransform.identity
//            }) { (_) in
//                self.view.mask = nil
//            }
//        }
    
    }

}
